-
Notifications
You must be signed in to change notification settings - Fork 411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Refactor] Classification 2/n #1143
Conversation
for more information, see https://pre-commit.ci
…hLightning/metrics into refactor/classification_1
for more information, see https://pre-commit.ci
…hLightning/metrics into refactor/classification_1
for more information, see https://pre-commit.ci
…hLightning/metrics into refactor/classification_1
for more information, see https://pre-commit.ci
|
||
Accepts the following input tensors: | ||
|
||
- ``preds`` (int or float tensor): ``(N, C, ...)``. If preds is a floating point tensor with values outside |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- ``preds`` (int or float tensor): ``(N, C, ...)``. If preds is a floating point tensor with values outside | |
- ``preds``: ``(N, C, ...)``. If preds is a floating point tensor with values outside |
this shall come from function footprint, right so I may skip it...
in case we have it elsewhere, lets prune/simplify in another PR package-wide
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it clear from the function footprint? That basically just states that this is a tensor.
Maybe it is not as important for multilabel, but for multiclass it is quite important to state this since the dtype is dependent on the shape and vice versa
https://github.com/Lightning-AI/metrics/blob/4c7de2257e4f4b58be6738271d79fa67c505ea9f/src/torchmetrics/classification/jaccard.py#L106-L108
* base structure * bincount * binary * files * stat score * multiclass + multilabel confmat * update * stat_score * change bincount * move back * del tests * rest of structure * confmat working * working binary stat scores * full testing * update * update * add missing tests * update * multilabel stat scores * disable old testing * more testing * flaky tests * changelog * refactor * class interface * fixes * typing * update * fix tests * Update src/torchmetrics/functional/classification/confusion_matrix.py * missing literal * add docstring to functional confusion matrix * add docstring to modular confusion matrix * add docstring to functional stat scores * add docstring to modular stat scores * make private * docs * fix mypy and doctests * fix docs formatting * literal backwards * custom movedim * docs * inits * fix * fix mistakes * working cohen kappa * Delete speed.py * cohen kappa done * working matthews * working jaccard * docstrings for jaccard * small improve * typing * fix doctest * try something * Apply suggestions from code review Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Daniel Stancl <[email protected]> Co-authored-by: Justus Schock <[email protected]> Co-authored-by: Jirka Borovec <[email protected]>
* base structure * bincount * binary * files * stat score * multiclass + multilabel confmat * update * stat_score * change bincount * move back * del tests * rest of structure * confmat working * working binary stat scores * full testing * update * update * add missing tests * update * multilabel stat scores * disable old testing * more testing * flaky tests * changelog * refactor * class interface * fixes * typing * update * fix tests * Update src/torchmetrics/functional/classification/confusion_matrix.py * missing literal * add docstring to functional confusion matrix * add docstring to modular confusion matrix * add docstring to functional stat scores * add docstring to modular stat scores * make private * docs * fix mypy and doctests * fix docs formatting * literal backwards * custom movedim * docs * inits * fix * fix mistakes * working cohen kappa * Delete speed.py * cohen kappa done * working matthews * working jaccard * docstrings for jaccard * small improve * typing * fix doctest * try something * Apply suggestions from code review Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Daniel Stancl <[email protected]> Co-authored-by: Justus Schock <[email protected]> Co-authored-by: Jirka Borovec <[email protected]>
* base structure * bincount * binary * files * stat score * multiclass + multilabel confmat * update * stat_score * change bincount * move back * del tests * rest of structure * confmat working * working binary stat scores * full testing * update * update * add missing tests * update * multilabel stat scores * disable old testing * more testing * flaky tests * changelog * refactor * class interface * fixes * typing * update * fix tests * Update src/torchmetrics/functional/classification/confusion_matrix.py * missing literal * add docstring to functional confusion matrix * add docstring to modular confusion matrix * add docstring to functional stat scores * add docstring to modular stat scores * make private * docs * fix mypy and doctests * fix docs formatting * literal backwards * custom movedim * docs * inits * fix * fix mistakes * working cohen kappa * Delete speed.py * cohen kappa done * working matthews * working jaccard * docstrings for jaccard * small improve * typing * fix doctest * try something * Apply suggestions from code review Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Daniel Stancl <[email protected]> Co-authored-by: Justus Schock <[email protected]> Co-authored-by: Jirka Borovec <[email protected]>
* base structure * bincount * binary * files * stat score * multiclass + multilabel confmat * update * stat_score * change bincount * move back * del tests * rest of structure * confmat working * working binary stat scores * full testing * update * update * add missing tests * update * multilabel stat scores * disable old testing * more testing * flaky tests * changelog * refactor * class interface * fixes * typing * update * fix tests * Update src/torchmetrics/functional/classification/confusion_matrix.py * missing literal * add docstring to functional confusion matrix * add docstring to modular confusion matrix * add docstring to functional stat scores * add docstring to modular stat scores * make private * docs * fix mypy and doctests * fix docs formatting * literal backwards * custom movedim * docs * inits * fix * fix mistakes * working cohen kappa * Delete speed.py * cohen kappa done * working matthews * working jaccard * docstrings for jaccard * small improve * typing * fix doctest * try something * Apply suggestions from code review Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Daniel Stancl <[email protected]> Co-authored-by: Justus Schock <[email protected]> Co-authored-by: Jirka Borovec <[email protected]>
* base structure * bincount * binary * files * stat score * multiclass + multilabel confmat * update * stat_score * change bincount * move back * del tests * rest of structure * confmat working * working binary stat scores * full testing * update * update * add missing tests * update * multilabel stat scores * disable old testing * more testing * flaky tests * changelog * refactor * class interface * fixes * typing * update * fix tests * Update src/torchmetrics/functional/classification/confusion_matrix.py * missing literal * add docstring to functional confusion matrix * add docstring to modular confusion matrix * add docstring to functional stat scores * add docstring to modular stat scores * make private * docs * fix mypy and doctests * fix docs formatting * literal backwards * custom movedim * docs * inits * fix * fix mistakes * working cohen kappa * Delete speed.py * cohen kappa done * working matthews * working jaccard * docstrings for jaccard * small improve * typing * fix doctest * try something * Apply suggestions from code review Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Daniel Stancl <[email protected]> Co-authored-by: Justus Schock <[email protected]> Co-authored-by: Jirka Borovec <[email protected]>
What does this PR do?
Continues work on classification refactor #1001
Prior work: #1054
This PR takes care of
CohenKappa
,JaccardIndex
andMatthewsCorrCoef
which all are subclassed fromConfusionMatrix
.Before submitting
PR review
Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.
Did you have fun?
Make sure you had fun coding 🙃